From 3d624ae31bb83570e93e133ba505a84f1417421c Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 29 Jan 2010 07:14:32 +0000 Subject: [PATCH] libelf: make elf_phdr_is_loadable load read-only segments. From: Brad Plant Signed-off-by: Keir Fraser --- xen/common/libelf/libelf-tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/libelf/libelf-tools.c b/xen/common/libelf/libelf-tools.c index 99a0a91576..e18f02d6db 100644 --- a/xen/common/libelf/libelf-tools.c +++ b/xen/common/libelf/libelf-tools.c @@ -235,7 +235,7 @@ int elf_phdr_is_loadable(struct elf_binary *elf, const elf_phdr * phdr) uint64_t p_type = elf_uval(elf, phdr, p_type); uint64_t p_flags = elf_uval(elf, phdr, p_flags); - return ((p_type == PT_LOAD) && (p_flags & (PF_W | PF_X)) != 0); + return ((p_type == PT_LOAD) && (p_flags & (PF_R | PF_W | PF_X)) != 0); } /* -- 2.30.2